from flask import Flask
from biz.api.routes import register_routes
from biz.api.middleware import apply_auth_middleware

# 创建Flask应用
app = Flask(__name__, static_url_path='')

# 配置 JSON 编码，确保中文不乱码
app.json.ensure_ascii = False

# 注册API路由
register_routes(app)

# 应用API认证中间件
apply_auth_middleware(app)

if __name__ == '__main__':
    app.run(debug=False, host='0.0.0.0', port=5000)